﻿@using System.Web.Mvc.Html
@using nanoCMS.Core
@using nanoCMS.Core.Membership
@using nanoCMS.Core.WebProviders.HtmlHelpers
@using nanoCMS.Forum.Resources
@using nanoCMS.Forum.WebUI.Models.ViewModels
@model PostDisplayVM

<!-- comment Box-->
<tr class="head">
    <td width="20%" align="left">@Model.Post.PostTime</td>
    <td width="80%" align="right"><div style="float: left;">@Model.Post.Title</div>#@Model.PostNumber</td>
</tr>
<tr>
    <td>
        <ul class="data">
                    <li class="user">@Model.User.DisplayName</li>
                    <li>
                    @if(AvatarProvider.AvatarExists(Model.User.UserID))
                    {
                        <img src="@(Url.Content(Settings.AvatarUploadPath) + AvatarProvider.GenerateAvatarName(Model.User.UserID))" alt="Avatar" />
                    } else {
                        <span>Kurac od avatara</span>
                    }
                    </li>
                    <li class="loc">@Translation.Location: @Model.Location</li>
                    <li class="loc">Admin</li>
                    <li class="loc">@Translation.NoPosts: @Model.UserInfo.PostCount</li>
                </ul>
    </td>
    <td class="verAlgn">@Model.Post.Content</td>
</tr>
<tr>
    <td colspan="2"><a href="#" title="" class="quote"><img src="images/forum/adminUser.png" alt="" class="icon">
<span>@Translation.Quote</span></a>
    @if (SessionManagerBase.IsAuthenticated && Model.User.UserID == SessionManagerBase.CurrentUserID || SessionManagerBase.IsAdmin)
    {
        @Html.LinkInner(Translation.Edit, new { postId = @Model.Post.PostID, elementKey = ViewBag.ElementKey, action = "EditPost" }, null)
    }
    @if (SessionManagerBase.IsAdmin)
    {
        @Html.LinkInner(Translation.Delete, new { threadId = Model.Post.ThreadID, postId = Model.Post.PostID, elementKey = ViewBag.ElementKey, action = "DeletePost" }, null)
    }
</td>
</tr>
@*

<div style="margin: 5px; border: 1px solid black;">
<div>post title : @Model.Title </div>
<div>post: content: @Model.Content</div>
    @Html.ActionLink("Edit", "EditPost", "Forum", new { postID = Model.PostID}, null)
    @if (Model.ThreadID != 0)
    {
        @Html.ActionLink("Delete", "DeletePost", "Forum", new { postID = Model.PostID, threadId = Model.ThreadID}, null)
    }
</div>*@